<!--
	作者：819115696@qq.com
	时间：2016-06-23
	描述：
-->
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
		<script type="text/javascript" src="js/test.js"></script>
		<script type="text/javascript" src="wjs/a16.js"></script>
		<style>
			.d {
				width: 200px;
				height: 200px;
			}
			
			table {
				border: 1px solid seagreen;
				border-collapse: collapse;
			}
			
			button {
				width: 100px;
				height: 30px;
				outline: none;
			}
		</style>
		<script>
			function queren() {
				alert("1")
			}
			aqiData={}
			var count = 0;
			function TR(){
				return document.createElement("tr");
			}
			function TD(sss){
				var td=document.createElement("td");
				td.innerHTML=sss;
				return td;
			}
			function btnclick(){
				var a = document.getElementById("aqi-city-input").value;
	            var b = document.getElementById("aqi-value-input").value;

				var tr=new TR();
				var td=new TD(a);
				//td.innerHTML=;
				tr.appendChild(td);
				tr.appendChild(new TD(b));
				document.getElementById("aqi-table").appendChild(tr);
			}
			function btnclick2(){
				var ttt=document.getElementById("aqi-table");
				alert(ttt.children.length);
				
				ttt.removeChild(ttt.children[0]);//删除子节点children不会包含到文本节点
			}
			$(function() {
				document.getElementById("add-btn").onclick=btnclick;
				document.getElementById("add-btn2").onclick=btnclick2;
			})
		</script>
	</head>

	<body>

		<div>
			<label>城市名称：<input id="aqi-city-input" type="text"></label><br>
			<label>空气质量指数：<input id="aqi-value-input" type="text"></label><br>
			<button id="add-btn">确认添加</button>
			<button id="add-btn2">确认删除</button>
		</div>
		<table id="aqi-table" border="1" style="">
			<!-- 
    <tr>
      <td>城市</td><td>空气质量</td><td>操作</td>
    </tr>
    <tr>
      <td>北京</td><td>90</td><td><button>删除</button></td>
    </tr>
    <tr>
      <td>北京</td><td>90</td><td><button>删除</button></td>
    </tr>
   -->
		</table>

	</body>

</html>